<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
<link rel="stylesheet" href="__PUBLIC__/css/reset.css">
<link rel="stylesheet" href="__PUBLIC__/css/index.css">
<link rel="stylesheet" href="__PUBLIC__/css/art.css">
<style>
form {
width:30%;
margin:0 auto;
}
</style>
</head>
<body>
    <header>
        <h1>Blog注册界面</h1>
    </header>
    <div id="main">
        <div id="respond" class="comment-respond">
            <form action="{:U('home/user/register')}" method="post">

                <p>
                <input placeholder="用户名" name="name" type="text" value="" size="30" id="username">
                </p>

                <span id="username_notice" style="color:#FF0000"></span>

                <p>
                <input placeholder="email" name="email" type="email" value="" size="30" id="email" id="email">
                </p>

                <span id="username_notice1" style="color:#FF0000"></span>

                <p>
                <input placeholder="密码" name="password" type="text" value="" size="30">
                </p>

                <p>
                <input placeholder="昵称" name="nick" type="text" value="" size="30" id="nick">
                </p>

                <p>    
                <input placeholder="验证码" type="text" class="inputBg" name="yzm" size="30"> 
                <img src="{:U('Home/User/yzm')}" id='lol' alt="" id="lol" />
                </p>

                <input type="submit" value="注册">

            </p>
            </form>
        </div>
    </div>
    
    <script src="__PUBLIC__/jquery-3.1.0.min.js"></script>

    <script>

    $('#username').blur(function(){
 
        var data={
        'username':$('input[name="name"]').val()
        };  

        var url="{:U('Home/User/CheckUsername')}"

        $.post(url,data,function(rs){
          if(rs == 1){
            $('#username_notice').html('用户名已经注册');
          }else{
            $('#username_notice').html('用户名可用');
          }
        },'json');
        
      });


    $('#email').blur(function(){
 
        var data={
        'email':$('input[name="email"]').val()
        };  

        var url="{:U('Home/User/CheckEmail')}"

        $.post(url,data,function(rs){
          if(rs == 1){
            $('#username_notice1').html('Email已经注册');
          }else{
            $('#username_notice1').html('Email可用');
          }
        },'json');
      });


   
    document.getElementById('lol').onclick = function(){
      
      var span = document.getElementById('lol');

        span.src="{:U('Home/User/yzm')}";

    }
  


    </script>

    <footer>
        Copyright &copy; 2015 · GeneratePress · WordPress
    </footer>
</body>
</html>